package com.ctrip.openapi.java.base;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;



public class DBPool {

	public DBPool() {
	}

	public static Connection getConnection() {
		Connection conn = null;
		try {
			String className = "com.mysql.jdbc.Driver";//cfg.getValue("dataSource.driverClassName");
			String userName ="root";// cfg.getValue("dataSource.username");
			String password ="vtroot";// cfg.getValue("dataSource.password");
			String url = "jdbc:mysql://localhost:3306/hotel?useUnicode=true&characterEncoding=UTF-8";//cfg.getValue("dataSource.url");
			Class.forName(className);
			conn = DriverManager.getConnection(url, userName, password);
		} catch (Exception e) {
			System.out.println("NEW DB CONNECTION ERROR: " + e.toString());
		}
		return conn;
	}
   
}
